home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
biz
/
dbase
/
mSQL2_src.lha
/
msql-2.0-B3
/
scripts
/
mkinstalldirs
< prev
next >
Wrap
Text File
|
1997-01-13
|
697b
|
39 lines
#!/bin/sh
# Make directory hierarchy.
# Written by Noah Friedman <friedman@prep.ai.mit.edu>
# Modified to include directory modes David J. Hughes (Bambi@Bond.edu.au)
# Public domain.
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
errstatus=0
MODE=$1
FILE=$2
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${FILE} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
for d in ${1+"$@"} ; do
pathcomp="${pathcomp}${d}"
if test ! -d "${pathcomp}"
then
echo "mkdir $pathcomp; chmod $MODE $pathcomp" 1>&2
mkdir "${pathcomp}" || errstatus=$?
chmod "${MODE}" "${pathcomp}" || errstatus=$?
fi
pathcomp="${pathcomp}/"
done
exit $errstatus
# eof